package com.ruoyi.review.service.impl;

import java.util.List;

import com.ruoyi.common.constant.SysConstants;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.review.mapper.SysEstimateMapper;
import com.ruoyi.review.domain.SysEstimate;
import com.ruoyi.review.service.ISysEstimateService;

/**
 * 评价Service业务层处理
 * 
 * @author YJF
 * @date 2023-05-08
 */
@Service
public class SysEstimateServiceImpl implements ISysEstimateService 
{
    @Autowired
    private SysEstimateMapper sysEstimateMapper;

    /**
     * 查询评价
     * 
     * @param estimateId 评价主键
     * @return 评价
     */
    @Override
    public SysEstimate selectSysEstimateByEstimateId(Long estimateId)
    {
        return sysEstimateMapper.selectSysEstimateByEstimateId(estimateId);
    }

    /**
     * 查询评价列表
     * 
     * @param sysEstimate 评价
     * @return 评价
     */
    @Override
    public List<SysEstimate> selectSysEstimateList(SysEstimate sysEstimate)
    {
        sysEstimate.setDelFlag(SysConstants.CONSTANT_STR0);
        return sysEstimateMapper.selectSysEstimateList(sysEstimate);
    }

    /**
     * 新增评价
     * 
     * @param sysEstimate 评价
     * @return 结果
     */
    @Override
    public int insertSysEstimate(SysEstimate sysEstimate)
    {
        sysEstimate.setCreateTime(DateUtils.getNowDate());
        return sysEstimateMapper.insertSysEstimate(sysEstimate);
    }

    /**
     * 修改评价
     * 
     * @param sysEstimate 评价
     * @return 结果
     */
    @Override
    public int updateSysEstimate(SysEstimate sysEstimate)
    {
        return sysEstimateMapper.updateSysEstimate(sysEstimate);
    }

    /**
     * 批量删除评价
     * 
     * @param estimateIds 需要删除的评价主键
     * @return 结果
     */
    @Override
    public int deleteSysEstimateByEstimateIds(Long[] estimateIds)
    {
        return sysEstimateMapper.deleteSysEstimateByEstimateIds(estimateIds);
    }

    /**
     * 删除评价信息
     * 
     * @param estimateId 评价主键
     * @return 结果
     */
    @Override
    public int deleteSysEstimateByEstimateId(Long estimateId)
    {
        return sysEstimateMapper.deleteSysEstimateByEstimateId(estimateId);
    }
}
